package com.acme.logginglab.mylogger;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

public class LoggerFactory implements ILoggerFactory{
	private static ConcurrentMap<String, Logger> logMap = new ConcurrentHashMap<String, Logger>();
	
	public Logger getLogger(String name) {
		Logger log = logMap.putIfAbsent(name, new MyLogger(name));
		
		return (log != null) ? log : logMap.get(name);
	}

}
